package com.lianxi.enums;

import lombok.Data;


public enum SexEnum {

    MALE("1","男"),

    FEMALE("0","女");

    private String sex;

    private String sexName;

    SexEnum(String sex, String sexName) {
        this.sex = sex;
        this.sexName = sexName;
    }

    SexEnum() {
    }


    public static SexEnum getType(String type){
        SexEnum[] types = SexEnum.values();
        for(SexEnum sexEnum:types){
          if(sexEnum.getSex().equals(type)){
              return sexEnum;
          }
        }
        return null;
    }


    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSexName() {
        return sexName;
    }

    public void setSexName(String sexName) {
        this.sexName = sexName;
    }
}
